/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.uniandes.vehialpes.servicios;

import co.edu.uniandes.vehialpes.garantias.GarantiasBean;
import co.edu.uniandes.vehialpes.garantias.Reparacion;
import co.edu.uniandes.vehialpes.garantias.Vehiculo;
import java.util.Date;
import javax.ejb.EJB;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.ejb.Stateless;

/**
 *
 * @author alvar-go@uniandes.edu.co
 */
@WebService(serviceName = "GarantiasService")
@Stateless()
public class GarantiasService {
    @EJB
    private GarantiasBean ejbRef;// Add business logic below. (Right-click in editor and choose
    // "Insert Code > Add Web Service Operation")

    @WebMethod(operationName = "estaEnGarantia")
    public boolean estaEnGarantia(@WebParam(name = "idVehiculo") String idVehiculo) throws Exception {
        return ejbRef.estaEnGarantia(idVehiculo);
    }

    @WebMethod(operationName = "darVehiculo")
    public Vehiculo darVehiculo(@WebParam(name = "idVehiculo") String idVehiculo) {
        return ejbRef.darVehiculo(idVehiculo);
    }

    @WebMethod(operationName = "registrarReparacion")
    public void registrarReparacion(@WebParam(name = "taller") String taller, @WebParam(name = "vehiculo") String vehiculo, @WebParam(name = "fecha") Date fecha, @WebParam(name = "descripcion") String descripcion, @WebParam(name = "costo") double costo) throws Exception {
        ejbRef.registrarReparacion(taller, vehiculo, fecha, descripcion, costo);
    }

    @WebMethod(operationName = "darReparacion")
    public Reparacion darReparacion(@WebParam(name = "idVehiculo") String idVehiculo) {
        return ejbRef.darReparacion(idVehiculo);
    }
    
}
